package com.centaur0.tags.util;

import java.util.Enumeration;

import javax.el.ELContext;
import javax.servlet.jsp.JspContext;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.el.ExpressionEvaluator;
import javax.servlet.jsp.el.VariableResolver;

import com.centaur0.io.JspWriterImpl;

@SuppressWarnings("deprecation")
public class JspContextWrapper extends JspContext {

	private JspContext context;
	private JspWriter out = new JspWriterImpl();
	
	public JspContextWrapper(JspContext context){
		this.context = context;
	}
	
	@Override
	public Object findAttribute(String arg0) {
		return context.findAttribute(arg0);
	}

	@Override
	public Object getAttribute(String arg0) {
		return context.getAttribute(arg0);
	}

	@Override
	public Object getAttribute(String arg0, int arg1) {
		return context.getAttribute(arg0, arg1);
	}

	@Override
	public Enumeration<String> getAttributeNamesInScope(int arg0) {
		return context.getAttributeNamesInScope(arg0);
	}

	@Override
	public int getAttributesScope(String arg0) {
		return context.getAttributesScope(arg0);
	}

	@Override
	public ELContext getELContext() {
		return context.getELContext();
	}

	@Override
	public ExpressionEvaluator getExpressionEvaluator() {
		return context.getExpressionEvaluator();
	}

	@Override
	public JspWriter getOut() {
		return this.out;
	}

	@Override
	public VariableResolver getVariableResolver() {
		return context.getVariableResolver();
	}

	@Override
	public void removeAttribute(String arg0) {
		context.removeAttribute(arg0);
	}

	@Override
	public void removeAttribute(String arg0, int arg1) {
		context.removeAttribute(arg0, arg1);
	}

	@Override
	public void setAttribute(String arg0, Object arg1) {
		context.setAttribute(arg0, arg1);
	}

	@Override
	public void setAttribute(String arg0, Object arg1, int arg2) {
		context.setAttribute(arg0, arg1, arg2);
	}

	public String getOutString() {
		return out.toString();
	}
	
	
}
